#include<ui.h>


int main(int argc, char** argv)
{
	int ret;
	Button tButton;
	Region tRegion;
	PDispBuffer ptBuffer;

	if (argc != 2)
	{
		printf("Usage: %s <font_file>\n", argv[0]);
		return -1;
	}

	DisplaySystemRegister();
	SelectDefaultDisplay("fb");
	InitDefaultDisplay();
	ptBuffer = GetDisplayBuffer();
	
	FontSymstemRegister();
	ret = SelectAndInitFont("freetype", argv[1]);
	if(ret)
	{
		printf("SelectAndInitFont err \n");
	}


	tRegion.iLeftUpX = 200;
	tRegion.iLeftUpY = 200;
	tRegion.iWidth   = 300;
	tRegion.iHeight   = 100;
	
	InitButton(&tButton, "Armelle", &tRegion, NULL, NULL);
	tButton.OnDraw(&tButton, ptBuffer);
	while (1)
	{
		tButton.OnPressed(&tButton, ptBuffer, NULL);
		sleep(2);
	}
	 
	return 0;
}


